#include <iostream>
#include <string>
using namespace std;

class person
{
public:
    void print()
    {
        cout << "name: " << _name << endl;
    }
protected:
// private:
    string _name = "peter";
    int _age = 19;
    int _num = 111111;
};

class student : public person
{
public:
    void func()
    {
        cout << _name << endl;
        cout << _age << endl;
    }

    int get_num()
    {
        return _num;
    }

    int get_person_num()
    {
        return person::_num;
    }

protected:
    // int _stuid;
    int _num = 222222;
};

class teacher : public person
{
protected:
    int _teaid;
};

void test_1()
{
    student s;
    s.print();
    s.func();
    cout << sizeof(s) << endl;
}

void test_2()
{
    double d = 1.1;
    const int& i = d;

    student s;
    person p;

    person& rp = s;
    p = s;
    p = (person)s;

    //s = p;
    //student s = p;
    //student& rs = p;
    //student* ps = p;
}

class A
{
public:
    void func()
    {
        cout << "A::func()" << endl;
    }
};

class B : public A
{
public:
    void func(int i)
    {
        A::func();
        cout << "B::func(int i)" << endl;
    }
};

void test_3()
{
    student s;
    cout << s.get_num() << endl;
    cout << s.get_person_num() << endl;

    B b;
    b.func(1);
    // b.func(); // ERROR
    b.A::func();
}